package cn.yunyichina.provider.sb.task;

import cn.yunyichina.provider.sb.service.impl.InHospitalReportServiceImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Calendar;
import java.util.concurrent.atomic.AtomicLong;

/**
 * Created by 15-AK on 2017/9/28.
 */
public class InHospitalReportUploadTask {
    private static Logger logger = LoggerFactory.getLogger(InHospitalReportUploadTask.class);

    private final AtomicLong idGen = new AtomicLong();

    public void startUp() {
        long count = idGen.incrementAndGet();
        if (logger.isInfoEnabled()) {
            logger.info("第 " + count + " 次商保住院报告信息上传开始....................");
        }
        Long statrTime = Calendar.getInstance().getTimeInMillis();
        InHospitalReportServiceImpl uploadService = new InHospitalReportServiceImpl();
        uploadService.uploadReportChecking();
        uploadService.uploadReportExamination();
        uploadService.uploadReportOperation();
        Long endTime = Calendar.getInstance().getTimeInMillis();
        if (logger.isInfoEnabled()) {
            logger.info("第 " + count + " 次商保住院报告信息上传结束 ,耗费时间" + ( endTime - statrTime ) + " Millis");
        }
    }
}
